RT_SECURE_NO_WARNINGS 1
#include"Heap.h"
void TestHeap1()
{
    HP hp;
    HeapInit(&hp);
    //插入数据
    HeapPush(&hp, 1);
    HeapPush(&hp, 2);
    HeapPush(&hp, 3);
    HeapPush(&hp, 6);
    HeapPush(&hp, 8);
    HeapPush(&hp, 9);
    //打印
    HeapPrint(&hp);
    //销毁
    HeapDestroy(&hp);
}
void TestHeap2()
{
    HP hp;
    HeapInit(&hp);
    //插入数据
    HeapPush(&hp, 1);
    HeapPush(&hp, 5);
    HeapPush(&hp, 3);
    HeapPush(&hp, 0);
    HeapPush(&hp, 8);
    HeapPush(&hp, 9);
    HeapPrint(&hp);//打印
    //删除堆顶数据
    HeapPop(&hp);
    HeapPrint(&hp);//打印
    //销毁
    HeapDestroy(&hp);
}
void testHeapSort()
{
    int a[] = { 16,72,31,23,94,53 };
    int n = sizeof(a) / sizeof(a[0]);
 
    HeapSort(a, n);
 
 
    for (int i = 0; i < n; i++)
    {
        printf("%d ", a[i]);
    }
}
int main()
{
    TestHeap1();
    TestHeap2();
    testHeapSort();
    return 0;
}


